package com.stx.openeyes.utils;

import android.text.TextUtils;

public class XStringUtil {

    public static String getFormatTime(int duration) {
        int last = duration % 60;
        String stringLast;
        if (last <= 9) {
            stringLast = "0" + last;
        } else {
            stringLast = last + "";
        }
        String durationString;
        int minit = duration / 60;
        if (minit < 10) {
            durationString = "0" + minit;
        } else {
            durationString = "" + minit;
        }
        return durationString + ":" + stringLast;
    }

    public static String getFormatTag(String tag) {
        return TextUtils.isEmpty(tag) ? "#" :
                "#".concat(tag.replace(",", " #"));
    }
}
